﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Data.SqlClient;
using System.Data;

namespace ExaminationSys.DataAccess
{
    public static class DataContent
    {
        private static string connectionString = ConfigurationManager.ConnectionStrings["defaultconnection"].ConnectionString;

        private static SqlConnection connection;
        public static SqlConnection DBServer()
        {
            connection = new SqlConnection(connectionString);
            connection.Open();
            return connection;
        }
        public static SqlConnection DBServer(string name)
        {
            connectionString = ConfigurationManager.AppSettings[name];
            connection = new SqlConnection(name);
            connection.Open();
            return connection;
        }


        public static SqlConnection DBServer(SqlConnection conn)
        {
            conn.Open();
            return conn;
        }
    }
}
